package com.financing.platform.vo;

import java.text.DecimalFormat;

import com.financing.platform.common.CsvExportable;



/**
 * 内部理财师统计-报表VO
 *
 */
public class LicashiCountVO extends BaseVO implements CsvExportable{
	
	private String userId;//内部理财师id
	
	private String telephone;//内部理财师手机号
	
	private String username;//内部理财师姓名

	private Integer shareCount;//邀请函次数
	
	private Integer shareRegCount;//邀请函注册次数
	
	private Integer shareAuthCount;//邀请函认证会员数
	
	private String shareRegAuthRatio;//邀请函会员转化率
	
	private Integer sysCount;//系统分配客户数
	
	private Integer sysRegCount;//系统分配客户注册数
	
	private Integer sysAuthCount;//系统分配客户认证数
	
	private String sysRegAuthRatio;//邀请函会员转化率
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getShareCount() {
		return shareCount==null?0:shareCount;
	}

	public void setShareCount(Integer shareCount) {
		this.shareCount = shareCount;
	}

	public Integer getShareRegCount() {
		return shareRegCount==null?0:shareRegCount;
	}

	public void setShareRegCount(Integer shareRegCount) {
		this.shareRegCount = shareRegCount;
	}

	public Integer getShareAuthCount() {
		return shareAuthCount==null?0:shareAuthCount;
	}

	public void setShareAuthCount(Integer shareAuthCount) {
		this.shareAuthCount = shareAuthCount;
	}
	DecimalFormat    df   = new DecimalFormat("######0.00");   
	public String getShareRegAuthRatio() {
		if(shareRegCount==0)return "0";
		return df.format((shareAuthCount*1.0/shareRegCount)*100)+"%";
	}

	public void setShareRegAuthRatio(String shareRegAuthRatio) {
		this.shareRegAuthRatio = shareRegAuthRatio;
	}

	public Integer getSysCount() {
		return sysCount==null?0:sysCount;
	}

	public void setSysCount(Integer sysCount) {
		this.sysCount = sysCount;
	}

	public Integer getSysRegCount() {
		return sysRegCount==null?0:sysRegCount;
	}

	public void setSysRegCount(Integer sysRegCount) {
		this.sysRegCount = sysRegCount;
	}

	public Integer getSysAuthCount() {
		return sysAuthCount==null?0:sysAuthCount;
	}

	public void setSysAuthCount(Integer sysAuthCount) {
		this.sysAuthCount = sysAuthCount;
	}

	public String getSysRegAuthRatio() {
		if(sysRegCount==0)return "0%";
		return df.format((sysAuthCount*1.0/(sysCount))*100)+"%";
	}

	public void setSysRegAuthRatio(String sysRegAuthRatio) {
		this.sysRegAuthRatio = sysRegAuthRatio;
	}

	@Override
	public String csvTitle() {
		return "理财师姓名,邀请函分享次数,邀请函吸引注册数,邀请函吸引认证会员数,邀请函会员转化率,系统分配客户数,系统分配客户注册数,系统分配客户认证会员数,系统分配会员转化率";
	}

	@Override
	public String toCsvString() {
		StringBuilder builder = new StringBuilder();
		builder.append(getUsername()).append(",")
		.append(getShareCount()).append(",")
		.append(getShareRegCount()).append(",")
		.append(getShareAuthCount()).append(",")
		.append(getShareRegAuthRatio()).append(",")
		.append(getSysCount()).append(",")
		.append(getSysRegCount()).append(",")
		.append(getSysAuthCount()).append(",")
		.append(getSysRegAuthRatio()).append(",");
		return builder.toString();
	}
}
